/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ditt.outils;

/**
 *
 * @author attobra
 */
public class GenererMotDePasse {
    
    public static final String VALEURS = "abcdefghijklmnopqrstuvwxyz0123456789";
    public static final int TAILLEMOTDEPASSE = 6;
    
    public static String generer(){
        char[] motDePasse = new char[TAILLEMOTDEPASSE];
        int indice=0;
        for(int i=0;i<TAILLEMOTDEPASSE;i++){
            indice = (int) (java.lang.Math.random() * VALEURS.length());
            motDePasse[i]= VALEURS.charAt(indice);
            
        }
        return new java.lang.String(motDePasse);
            
        }
        
    
  public static void main (String[] args){
      
      javax.swing.JOptionPane.showMessageDialog(null, generer());
  }
    
}
